import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description: 图书借阅(不会写）
 * User: DELL
 * Date: 2024-05-23
 * Time: 0:11
 */
public class Main9 {
    static int MAXN = 100001;
    static long[] max = new long[MAXN << 2];
    static long[] add = new long[MAXN << 2];

    /**
     * 最大值信息汇总
     */
    private static void up(int i) {
        max[i] = Math.max(max[i << 1], max[i << 1 | 1]);
    }

    /**
     * 懒更新
     *
     * @param i
     */
    private static void lazy(int i, long v) {
        max[i] += v;
        add[i] += v;
    }

    /**
     * 懒信息下发
     */
    private static void down(int i) {
        if (add[i] != 0) {
            // 发左
            lazy(i << 1, add[i]);
            // 发右
            lazy(i << 1 | 1, add[i]);
            add[i] = 0;
        }
    }

    /**
     * 建树
     */
    private static void build(int i, int l, int r) {
        if (l == r) {
            max[i] = 0;
        } else {
            int mid = (l + r) >> 1;
            build(i << 1, l, mid);
            build(i << 1 | 1, mid + 1, r);
            up(i);
        }
    }

    /**
     * 范围更新
     */
    private static void update(int jobL, int jobR, long jobV, int i, int l, int r) {
        if (jobL <= l && r <= jobR) {
            lazy(i, jobV);
        } else {
            int mid = (l + r) >> 1;
            down(i);
            if (jobL <= mid) {
                update(jobL, jobR, jobV, i << 1, l, mid);
            }
            if (mid < jobR) {
                update(jobL, jobR, jobV, i << 1 | 1, mid + 1, r);
            }
            up(i);
        }
    }

    /**
     * 范围查询最大值
     */
    private static long query(int jobL, int jobR, int i, int l, int r) {
        if (jobL <= l && r <= jobR) {
            return max[i];
        } else {
            int mid = (l + r) >> 1;
            down(i);
            long res = Long.MIN_VALUE;
            if (jobL <= mid) {
                res = Math.max(res, query(jobL, jobR, i << 1, l, mid));
            }
            if (mid < jobR) {
                res = Math.max(res, query(jobL, jobR, i << 1 | 1, mid + 1, r));
            }
            return res;
        }
    }

    /**
     * 获取最左侧的最大值下标
     */
    private static int getMaxIndex(int i, int l, int r) {
        if (l == r) {
            return l;
        } else {
            int mid = (l + r) >> 1;
            down(i);
            if (max[i << 1] >= max[i << 1 | 1]) {
                return getMaxIndex(i << 1, l, mid);
            } else {
                return getMaxIndex(i << 1 | 1, mid + 1, r);
            }
        }
    }

    private static long getMax() {
        return query(1, 100000, 1, 1, 100000);
    }

    static class Node {
        int l;
        int r;

        public Node(int l, int r) {
            this.l = l;
            this.r = r;
        }
    }

    static int[] a;
    static PriorityQueue<Integer>[] pq;
    static ArrayList<Node>[] dingYue;

    private static void init(int n) {
        pq = new PriorityQueue[n];
        for (int i = 0; i < n; i++) {
            pq[i] = new PriorityQueue<Integer>();
        }
        dingYue = new ArrayList[n];
        for (int i = 0; i < n; i++) {
            dingYue[i] = new ArrayList<Node>();
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 录入数据
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int x = scanner.nextInt();
        init(n);
        a = new int[n];
        for (int i = 0; i < n; i++) {
            a[n] = scanner.nextInt();
        }
        for (int i = 0; i < m; i++) {
            int b = scanner.nextInt();
            dingYue[b].add(new Node(scanner.nextInt(), scanner.nextInt()));
        }
        // 根据每个图书进行单独处理，处理出每增加一本后可以多满足的借阅信息的条数的递增记录
        for (int i = 0; i < n; i++) {
            fun(i);
        }
        // 利用堆来维护每一个双端队列，然后依次进行分配，将 x 个全部分下去。
    }

    private static void fun(int index) {
        HashMap<Integer, LinkedList<Integer>> map = new HashMap<>();
        build(1, 1, 100000);
        for (int i = 0; i < dingYue[index].size(); i++) {
            Node node = dingYue[index].get(i);
            if (map.containsKey(node.l)) {
                map.get(node.l).add(node.r);
            } else {
                map.put(node.l, new LinkedList<Integer>());
                map.get(node.l).add(node.r);
            }
            update(node.l, node.r, 1, 1, 1, 100000);
        }
        long pre = getMax();
        int temp = 0;
        while (pre > a[index]) {
            long cur = getMax();
            if (cur != pre) {
                pq[index].add(temp);
                temp = 0;
                pre = cur;
                continue;
            }
            int maxIndex = getMaxIndex(1, 1, 100000);
            temp++;
        }
    }
}
